<style>
	.left{
		float:left;
	}
	.right{
		float:left;
	}
	.but{
		padding-left:25%;
		margin-top:20px;
	}
</style>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>余额提现</title>
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
		<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
		<script src="__PUBLIC__/static/layui/layui.all.js"></script>
	</head>
	<body>
		<form class="layui-form update_form" id='my_form'>
			<input type="hidden" name='id' value="{$set_info['id']}">
			<div class='left'>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width: 35%;">优惠券面额1：</label>
					<div class="layui-input-block update_shurk" style="width: 50%;">
						<input type="text" style="width: 65%;"  value="{$set_info['one_money']}" name="one_money" id='one_money' placeholder="" class="layui-input" lay-verify="required|check_moeny"  onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width: 35%;">优惠券面额2：</label>
					<div class="layui-input-block update_shurk" style="width: 50%;">
						<input type="text" style="width: 65%;" value="{$set_info['two_money']}" name="two_money" id='two_money' placeholder="" class="layui-input" lay-verify="required|check_moeny"  onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width: 35%;">优惠券面额3：</label>
					<div class="layui-input-block update_shurk" style="width: 50%;">
						<input type="text" style="width: 65%;" value="{$set_info['three_money']}" name="three_money" id='three_money' placeholder="" class="layui-input" lay-verify="required|check_moeny"  onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
					</div>
				</div>
			</div>
			
			<div class='right'>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width: 30%;">鼓励金：</label>
					<div class="layui-input-block update_shurk" style="width: 50%;">
						<input type="text" style="width: 65%;"  value="<?php echo $set_info['one_money']*4?>" id='glj_one' placeholder="" class="layui-input" lay-verify="required|check_moeny"  disabled="disabled">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width: 30%;">鼓励金：</label>
					<div class="layui-input-block update_shurk" style="width: 50%;">
						<input type="text" style="width: 65%;"  value="<?php echo $set_info['two_money']*4?>" id="glj_two" placeholder="" class="layui-input" lay-verify="required|check_moeny"  disabled="disabled">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label" style="width: 30%;">鼓励金：</label>
					<div class="layui-input-block update_shurk" style="width: 50%;">
						<input type="text" style="width: 65%;"  value="<?php echo $set_info['three_money']*4?>" id="glj_three" placeholder="" class="layui-input" lay-verify="required|check_moeny"   disabled="disabled">
					</div>
				</div>
			</div>
			
			<div class="layui-form-item update_btnbox">
				<div class="layui-input-block but">
					<button  id='change_but' class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
				</div>
			</div>
		</form>
	</body>
</html>
<script>
function set_content(){
	 $.ajax({
     	type:"post",
        url:"{:url('index/set_cz')}",
        data: $('#my_form').serialize(),
        success:function(data){
            layer.msg(data.msg, {
				  icon: 1,
				  time: 1500 
				}, function(){
					var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
					parent.layer.close(index);
			});
        }
	});
}
	
	
	
	
//图片上传
layui.use(['form'], function(){
	var $ = layui.jquery,form = layui.form;
	
	form.verify({
	  check_moeny: function(value, item){ //value：表单的值、item：表单的DOM对象
	    if(value > 5000){
	    	return "金额不能大于5000";
	    }
	    
	    if(value < 1){
	    	return "金额不能小于1元";
	    }
	  }
	});
	
	
  	//监听提交
	form.on('submit(demo1)', function(data){
		$('#change_but').addClass("layui-btn-disabled");
		
		set_content();
		
		return false;
	});
	
})


	
	$(document).ready(function(){  
	    $("#one_money").keyup(function(){  
	    	var one_money = $('#one_money').val();
		    $('#glj_one').val(one_money*4);
	    }); 
	    $("#two_money").keyup(function(){  
	    	var two_money = $('#two_money').val();
		    $('#glj_two').val(two_money*4);
	    });
	    $("#three_money").keyup(function(){  
	    	var three_money = $('#three_money').val();
		    $('#glj_three').val(three_money*4);
	    });
	});
</script>
